package it.pecuswap.utils;

import java.util.Date;

import org.joda.time.Interval;
import org.joda.time.Period;

public class DateUtils {

	public static boolean isMinorenne(Date dataNascita) {
		Date today = new Date();
		Interval interval = new Interval(dataNascita.getTime(), today.getTime());
		Period period = interval.toPeriod();
		
		if (period.getYears() < 18){
			return true;
		} else{
			return false;
		}
	}
}
